home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / Pocket6.3 / Extensions / Starting / Chapter 12 / Buzz next >
Text File  |  1994-06-24  |  2KB  |  41 lines

  1. \ Buzz demo from Starting Forth
  2. \ NOTE: If it says: ' UM*  ? ' below,
  3. \       load the file 'Brodie' first.
  4.  
  5. forget task : task ;
  6.  
  7. : EVEN ( n -- n' ) dup 2 mod + ;  \ round up to even number
  8. : "  34 word  c@ here 1+  over here swap even allot  rot cmove ;
  9.  
  10. variable RND  here rnd !
  11. : RANDOM ( -- ) rnd @  31421 *  6927 +  dup rnd even ! ;
  12. : CHOOSE ( u -- u' ) random um*  swap drop ;
  13.  
  14. create BUZZWORDS  ( -- addr )
  15.     " integrated          management          criteria               "
  16.     " total               organization        flexability            "
  17.     " systematized        monitored           capability             "
  18.     " parallel            reciprocal          mobility               "
  19.     " functional          digital             programming            "
  20.     " responsive          logistical          concepts               "
  21.     " optimal             transitional        time phasing           "
  22.     " synchronized        incremental         projections            "
  23.     " compatible          third generation    hardware               "
  24.     " qualified           policy              through-put            "
  25.     " partial             decision            engineering            "
  26.  
  27. : BUZZWORD ( row# column# -- addr )
  28.     20 *  swap  64 * +  buzzwords + ;
  29. : .BUZZWORD ( r# c# -- ) buzzword 20 -trailing type ;
  30. : 1ADJECTIVE  10 choose  0 .buzzword ;
  31. : 2ADJECTIVE  10 choose  1 .buzzword ;
  32. : NOUN        10 choose  2 .buzzword ;
  33. : PHRASE  1adjective space 2adjective space noun ;
  34. : PARAGRAPH
  35.     cr ." By using " phrase ."  coordinated with "
  36.     cr phrase ."  it is possible for even the most "
  37.     cr phrase ."  to function as "
  38.     cr phrase ."  within the constraints of "
  39.     cr phrase ." ." ;
  40. paragraph
  41.